<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册 - 家族树</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#10B981',
                        accent: '#8B5CF6',
                        dark: '#1E293B',
                        light: '#F8FAFC'
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .text-shadow {
                text-shadow: 0 2px 4px rgba(0,0,0,0.1);
            }
            .transition-custom {
                transition: all 0.3s ease;
            }
            .card-hover {
                @apply hover:shadow-lg hover:-translate-y-1 transition-all duration-300;
            }
            .nav-link {
                @apply relative px-3 py-2 text-gray-700 hover:text-primary transition-colors duration-200;
            }
            .nav-link::after {
                @apply content-[''] absolute bottom-0 left-0 w-0 h-0.5 bg-primary transition-all duration-200;
            }
            .nav-link:hover::after {
                @apply w-full;
            }
        }
    </style>
</head>
<body class="bg-gray-50 font-sans text-gray-800 min-h-screen flex flex-col">
    <!-- 顶部导航栏 -->
    <header class="sticky top-0 z-50 bg-white shadow-sm transition-all duration-300" id="navbar">
        <div class="container mx-auto px-4 sm:px-6 lg:px-8">
            <div class="flex justify-between items-center h-16">
                <div class="flex items-center">
                    <a href="index.html" class="flex items-center">
                        <i class="fa fa-sitemap text-primary text-2xl mr-2"></i>
                        <span class="font-bold text-xl text-dark">家族树</span>
                    </a>
                </div>
                
                <!-- 桌面导航 -->
                <nav class="hidden md:flex space-x-8">
                    <a href="index.html" class="nav-link">首页</a>
                    <a href="library.html" class="nav-link">家族资料库</a>
                    <a href="ai-access.html" class="nav-link">AI快速访问</a>
                    <a href="honors.html" class="nav-link">家族荣誉榜</a>
                    <a href="disgraces.html" class="nav-link">家族耻辱榜</a>
                </nav>
                
                <!-- 移动端菜单按钮 -->
                <div class="md:hidden">
                    <button id="menu-toggle" class="text-gray-700 hover:text-primary focus:outline-none">
                        <i class="fa fa-bars text-xl"></i>
                    </button>
                </div>
            </div>
        </div>
        
        <!-- 移动端导航菜单 -->
        <div id="mobile-menu" class="hidden md:hidden bg-white shadow-md absolute w-full">
            <div class="px-4 py-3 space-y-2">
                <a href="index.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">首页</a>
                <a href="library.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">家族资料库</a>
                <a href="ai-access.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">AI快速访问</a>
                <a href="honors.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">家族荣誉榜</a>
                <a href="disgraces.html" class="block px-3 py-2 text-gray-700 hover:bg-gray-100 rounded-md">家族耻辱榜</a>
            </div>
        </div>
    </header>

    <main class="flex-grow flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8">
        <div class="max-w-md w-full space-y-8">
            <div class="text-center">
                <i class="fa fa-sitemap text-primary text-5xl mb-4"></i>
                <h2 class="mt-6 text-3xl font-extrabold text-gray-900">创建新账户</h2>
                <p class="mt-2 text-sm text-gray-500 max-w-md">
                    加入我们，开始记录和传承您的家族历史
                </p>
            </div>

            <!-- 注册表单 -->
            <div class="bg-white shadow-md rounded-lg overflow-hidden">
                <div class="px-6 py-6 space-y-6">
                    <div class="rounded-md -space-y-px">
                        <div class="mb-4">
                            <label for="username" class="block text-sm font-medium text-gray-700 mb-1">用户名</label>
                            <div class="relative">
                                <span class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500">
                                    <i class="fa fa-user"></i>
                                </span>
                                <input id="username" name="username" type="text" required
                                    class="pl-10 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md py-3 border"
                                    placeholder="请输入用户名">
                            </div>
                        </div>
                        <div class="mb-4">
                            <label for="phone" class="block text-sm font-medium text-gray-700 mb-1">手机号</label>
                            <div class="relative">
                                <span class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500">
                                    <i class="fa fa-phone"></i>
                                </span>
                                <input id="phone" name="phone" type="tel" required
                                    class="pl-10 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md py-3 border"
                                    placeholder="请输入手机号">
                            </div>
                        </div>
                        <div class="mb-4">
                            <label for="verify-code" class="block text-sm font-medium text-gray-700 mb-1">验证码</label>
                            <div class="relative flex items-center">
                                <span class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500">
                                    <i class="fa fa-key"></i>
                                </span>
                                <input id="verify-code" name="verify-code" type="text" required
                                    class="pl-10 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md py-3 border mr-2"
                                    placeholder="请输入验证码">
                                <button type="button" id="get-code" class="text-sm bg-primary/10 text-primary px-3 py-3 rounded-md hover:bg-primary/20 transition-colors">
                                    获取验证码
                                </button>
                            </div>
                        </div>
                        <div class="mb-4">
                            <label for="password" class="block text-sm font-medium text-gray-700 mb-1">设置密码</label>
                            <div class="relative">
                                <span class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500">
                                    <i class="fa fa-lock"></i>
                                </span>
                                <input id="password" name="password" type="password" required
                                    class="pl-10 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md py-3 border"
                                    placeholder="请设置密码">
                            </div>
                        </div>
                        <div class="mb-4">
                            <label for="confirm-password" class="block text-sm font-medium text-gray-700 mb-1">确认密码</label>
                            <div class="relative">
                                <span class="absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500">
                                    <i class="fa fa-lock"></i>
                                </span>
                                <input id="confirm-password" name="confirm-password" type="password" required
                                    class="pl-10 block w-full shadow-sm sm:text-sm border-gray-300 rounded-md py-3 border"
                                    placeholder="请确认密码">
                            </div>
                        </div>
                    </div>

                    <div class="flex items-start">
                        <div class="flex items-center h-5">
                            <input id="agreement" name="agreement" type="checkbox" required
                                class="focus:ring-primary h-4 w-4 text-primary border-gray-300 rounded">
                        </div>
                        <div class="ml-3 text-sm">
                            <label for="agreement" class="text-gray-600">
                                我已阅读并同意 <a href="#" class="text-primary hover:text-primary/80">用户协议</a> 和 <a href="#" class="text-primary hover:text-primary/80">隐私政策</a>
                            </label>
                        </div>
                    </div>

                    <div>
                        <button type="button" id="register-btn" class="w-full flex justify-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary transition-colors">
                            立即注册
                        </button>
                    </div>
                </div>
            </div>

            <div class="relative">
                <div class="absolute inset-0 flex items-center">
                    <div class="w-full border-t border-gray-300"></div>
                </div>
                <div class="relative flex justify-center text-sm">
                    <span class="px-2 bg-gray-50 text-gray-500">其他注册方式</span>
                </div>
            </div>

            <!-- 其他注册方式 -->
            <div class="grid grid-cols-2 gap-4">
                <button type="button" class="flex flex-col items-center justify-center p-4 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors group">
                    <i class="fa fa-weixin text-3xl text-green-500 mb-2 group-hover:scale-110 transition-transform"></i>
                    <span class="text-sm text-gray-700">微信注册</span>
                </button>
                <button type="button" class="flex flex-col items-center justify-center p-4 border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors group">
                    <i class="fa fa-credit-card text-3xl text-blue-500 mb-2 group-hover:scale-110 transition-transform"></i>
                    <span class="text-sm text-gray-700">支付宝注册</span>
                </button>
            </div>

            <p class="text-center text-sm text-gray-500">
                已有账户？ <a href="login.html" class="font-medium text-primary hover:text-primary/80">立即登录</a>
            </p>
        </div>
    </main>

    <!-- 页脚 -->
    <footer class="bg-dark text-white py-12">
        <div class="container mx-auto px-4 sm:px-6 lg:px-8">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h3 class="text-lg font-bold mb-4 flex items-center">
                        <i class="fa fa-sitemap text-primary mr-2"></i> 家族树
                    </h3>
                    <p class="text-gray-400 text-sm">连接过去，现在和未来，构建完整的家族历史图谱。</p>
                </div>
                <div>
                    <h4 class="font-bold mb-4">功能导航</h4>
                    <ul class="space-y-2 text-gray-400 text-sm">
                        <li><a href="index.html" class="hover:text-primary transition-colors">首页</a></li>
                        <li><a href="library.html" class="hover:text-primary transition-colors">家族资料库</a></li>
                        <li><a href="ai-access.html" class="hover:text-primary transition-colors">AI快速访问</a></li>
                        <li><a href="honors.html" class="hover:text-primary transition-colors">家族荣誉榜</a></li>
                        <li><a href="disgraces.html" class="hover:text-primary transition-colors">家族耻辱榜</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-bold mb-4">帮助中心</h4>
                    <ul class="space-y-2 text-gray-400 text-sm">
                        <li><a href="#" class="hover:text-primary transition-colors">使用指南</a></li>
                        <li><a href="#" class="hover:text-primary transition-colors">常见问题</a></li>
                        <li><a href="#" class="hover:text-primary transition-colors">联系支持</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="font-bold mb-4">联系我们</h4>
                    <ul class="space-y-2 text-gray-400 text-sm">
                        <li class="flex items-center"><i class="fa fa-envelope-o mr-2"></i> support@familytree.com</li>
                        <li class="flex items-center"><i class="fa fa-phone mr-2"></i> +86 123 4567 8910</li>
                    </ul>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                <p>&copy; 2023 家族树应用. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <!-- JavaScript -->
    <script>
        // 移动端菜单切换
        document.getElementById('menu-toggle').addEventListener('click', function() {
            const mobileMenu = document.getElementById('mobile-menu');
            mobileMenu.classList.toggle('hidden');
        });

        // 导航栏滚动效果
        window.addEventListener('scroll', function() {
            const navbar = document.getElementById('navbar');
            if (window.scrollY > 10) {
                navbar.classList.add('shadow-md');
                navbar.classList.remove('shadow-sm');
            } else {
                navbar.classList.remove('shadow-md');
                navbar.classList.add('shadow-sm');
            }
        });

        // 获取验证码按钮逻辑
        document.getElementById('get-code').addEventListener('click', function() {
            const phoneInput = document.getElementById('phone');
            const phone = phoneInput.value.trim();
            if (!phone) {
                alert('请输入手机号');
                return;
            }
            if (!/^1[3-9]\d{9}$/.test(phone)) {
                alert('请输入有效的手机号');
                return;
            }
            // 模拟发送验证码
            this.disabled = true;
            this.textContent = '60秒后重新获取';
            let countdown = 60;
            const timer = setInterval(() => {
                countdown--;
                this.textContent = `${countdown}秒后重新获取`;
                if (countdown <= 0) {
                    clearInterval(timer);
                    this.disabled = false;
                    this.textContent = '获取验证码';
                }
            }, 1000);
            alert('验证码已发送到您的手机，请注意查收');
        });

        // 注册按钮逻辑
        document.getElementById('register-btn').addEventListener('click', function() {
            const username = document.getElementById('username').value.trim();
            const phone = document.getElementById('phone').value.trim();
            const verifyCode = document.getElementById('verify-code').value.trim();
            const password = document.getElementById('password').value.trim();
            const confirmPassword = document.getElementById('confirm-password').value.trim();
            const agreement = document.getElementById('agreement').checked;

            if (!username) {
                alert('请输入用户名');
                return;
            }
            if (!phone || !/^1[3-9]\d{9}$/.test(phone)) {
                alert('请输入有效的手机号');
                return;
            }
            if (!verifyCode) {
                alert('请输入验证码');
                return;
            }
            if (!password || password.length < 6) {
                alert('请设置至少6位的密码');
                return;
            }
            if (password !== confirmPassword) {
                alert('两次输入的密码不一致');
                return;
            }
            if (!agreement) {
                alert('请阅读并同意用户协议和隐私政策');
                return;
            }

            // 模拟注册成功
            alert('注册成功！即将跳转到登录页面');
            window.location.href = 'login.html';
        });

        // 微信注册按钮逻辑
        document.querySelector('.fa-weixin').parentElement.addEventListener('click', function() {
            alert('微信注册功能已启动，请使用微信扫码注册');
            // 实际应用中这里会触发微信注册流程
        });

        // 支付宝注册按钮逻辑
        document.querySelector('.fa-credit-card').parentElement.addEventListener('click', function() {
            alert('支付宝注册功能已启动，请使用支付宝扫码注册');
            // 实际应用中这里会触发支付宝注册流程
        });
    </script>
</body>
</html>